Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix empty image when navigating to new editor from an editor with image #5897

Merged
merged 1 commit into from
Oct 21, 2015

Conversation

kevinansfield
Copy link
Member

closes #5840

  • calls the reset() function on the uploader if attrs change and the new image is empty

Issue was that when navigating from editing a post directly to writing a new post the controller and components are re-used with new values, because we are relying on a jQuery plugin we need to explicitly reset the plugin.

@ErisDS
Copy link
Member

ErisDS commented Oct 7, 2015

Just to be awkward, I tested out what happens if you hit the back button after going from an editor with an image, to a new editor. In this case the image is missing!

@kevinansfield
Copy link
Member Author

So the path is:

  1. Edit a post with an image
  2. Start a new post
  3. Click the back button to go back to the first post editor
  4. See that the post image is now missing

@ErisDS
Copy link
Member

ErisDS commented Oct 7, 2015

Yes, sorry - exactly that 👍

@kevinansfield kevinansfield force-pushed the fix-cover-post branch 2 times, most recently from bd773cc to 05bb2cd Compare October 18, 2015 11:53
@kevinansfield
Copy link
Member Author

This has been fixed up now. Would be great to re-visit the uploader at some point and re-implement with more control on the ember side.

closes TryGhost#5840
- calls `reset()` on the uploader when re-rendered with a blank image
- calls `reset()` and `initWithImage()` on the uploader when re-rendered with an image and the uploader is still in the "blank" state
ErisDS added a commit that referenced this pull request Oct 21, 2015
Fix empty image when navigating to new editor from an editor with image
@ErisDS ErisDS merged commit b2ada63 into TryGhost:master Oct 21, 2015
@ErisDS ErisDS deleted the fix-cover-post branch October 21, 2015 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: New Post has Blank Cover Image when Created from Exiting Post with a Cover Image
2 participants